﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="productlistmode_parameter.aspx.cs" Inherits="YXShop.Web.admin.templates.label.productlistmode_parameter" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>无标题页</title>
    <link href="../../style/admin.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
function ReturnValue()
{
   //自定义内容
    var mystyle =document.getElementById("txtLabelContent").value;
	var fileName=document.getElementById("tb_FileName").value;
	if(fileName=="")
	{
	   alert("文件名称不能为空！");
	   return false;
	}
	var cnm ="[YX:unLoop,YX:LableType=ProductListMakeup,YX:FileName="+fileName+"]"+mystyle+"[/YX:unLoop]";
	 
    parent.getValue(cnm);
	 CloseDiv();

}

function getValue(value)
{
    var textObj=document.getElementById("txtLabelContent");
    var textFeildValue=value;
    if(value!="") 
    {
        if(document.all)
        {     
            if(textObj.createTextRange && textObj.caretPos)
            {   
                var caretPos=textObj.caretPos;   
                caretPos.text=caretPos.text.charAt(caretPos.text.length-1)==''?textFeildValue+'':textFeildValue;   
            }
            else
            {   
                textObj.value=textFeildValue;   
            }   
        }
        else
        {   
            if(textObj.setSelectionRange)
            {   
                var rangeStart =textObj.selectionStart;   
                var rangeEnd=textObj.selectionEnd;   
                var tempStr1=textObj.value.substring(0,rangeStart);   
                var tempStr2 =textObj.value.substring(rangeEnd);   
                textObj.value=tempStr1+textFeildValue+tempStr2;   
            }
            else
            {   
                alert("This version of Mozilla based browser does not support setSelectionRange");   
            }   
        }
    }
}
function setCaret(textObj)
{   
    if(textObj.createTextRange)
    {   
        textObj.caretPos=document.selection.createRange().duplicate();   
    }   
} 
function CloseDiv()
{
    parent.document.getElementById("LabelDivid").style.display="none";
}

</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <table style="width: 100%;" class="form_table_input" >
            <tr>
                <td>
                    排序字段</td>
                <td>
                    <asp:DropDownList ID="ddl_card" runat="server" Height="25px" Width="151px" 
                        onchange="javascript:getValue(this.value);">
                        <asp:ListItem Value="">--请选择排序字段--</asp:ListItem>
                        <asp:ListItem Value="[#Compositor_AllShow]">默认显示</asp:ListItem>
                        <asp:ListItem Value="[#Compositor_Price]">商品价格</asp:ListItem>
                        <asp:ListItem Value="[#Compositor_Time]">上架时间</asp:ListItem>
                        
                    </asp:DropDownList></td>
                <td>
                    排版方式</td>
                <td>
                    <asp:DropDownList ID="ddl_Option" runat="server" Height="25px" Width="142px"  onchange="javascript:getValue(this.value);" >
                     <asp:ListItem Value="">--请选择排版方式--</asp:ListItem>
                        <asp:ListItem Value="[#Makeup_Pic]">按缩略图方式(显示文字)</asp:ListItem>
                        <asp:ListItem Value="[#Makeup_List]">按列表方式(显示文字)</asp:ListItem>
                        <asp:ListItem Value="[#Makeup_Images_List]">按图片方式(显示文字)</asp:ListItem>
                        <asp:ListItem Value="[#Makeup_Pic_Images]">按缩略图方式(显示图片)</asp:ListItem>
                        <asp:ListItem Value="[#Makeup_List_Images]">按列表方式(显示图片)</asp:ListItem>
                        <asp:ListItem Value="[#Makeup_Images_Images]">按图片方式(显示图片)</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                    文件名称</td>
                <td><asp:TextBox ID="tb_FileName" runat="server"></asp:TextBox><span style="color:Red;">.aspx</span></td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
            </tr>
            <tr><td colspan="4" style="color:Red">注：排版方式中按列表方式排版的文件名称系统会自动在按缩略图方式的文件名称上加2，在文件命名时请注意。(如：按缩略图方式排版的文件名称是Shop.aspx,那么按列表方式排版的文件名称应该是Shop2.aspx)</td></tr>
            <tr>
                <td colspan="4">
                    <asp:TextBox runat="server" ID="txtLabelContent" Height="200" onselect="setCaret(this);"
                        onclick="setCaret(this);" onkeyup="setCaret(this);" Width="600" TextMode="MultiLine"></asp:TextBox>
               </td>
            </tr>
            <tr>
                <td colspan="4" align="center" style="text-align:center">
                   <input id="bt_Exc" type="button" value="提交" onclick="ReturnValue()" />
                    &nbsp;<input class="form" type="button" value=" 关 闭 "  onclick="javascript:CloseDiv();" /></td>
            </tr>
            </table>
    </div>
    </form>
</body>
</html>